package edu.sctu.practice.class02.yangyuran.assign03.assign3_02;

/**
 * Created by Administrator on 2015/10/23.
 */
public class ComparableCircle extends Circle implements Comparable {

    public ComparableCircle(double radius) {
        super(radius);
    }

    @Override
    public int compareTo(Object o) {
        Circle circle = (Circle) o;
        if (getArea() > circle.getArea())
            return 1;
        else if (getArea() < circle.getArea())
            return -1;
        else
            return 0;
    }
}
